package com.huawei.appgallery.wishwall.ui.cardkit.card;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.format.DateUtils;
import android.view.View;
import android.view.View.OnClickListener;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.wishwall.ui.activity.WishWallDetailActivityProtocol;
import com.huawei.appgallery.wishwall.ui.activity.WishWallDetailActivityProtocol.Request;
import com.huawei.appgallery.wishwall.ui.cardkit.bean.WishWallListCardBean;
import huawei.widget.HwTextView;
import o.cgz;
import o.chy;
import o.cil;
import o.cim.a;
import o.ddq.b;
import o.ddq.d;
import o.ddq.e;
import o.ddq.f;
import o.ContentManager;
import o.epv;
import o.MinimumFactory;
import o.evx;
import o.fho;
import o.fiu;
import o.fjb;

public class WishWallListCard extends cgz {
    private View ʻ;
    private HwTextView ˊ;
    private HwTextView ˋ;
    private HwTextView ˎ;
    private HwTextView ˏ;
    private HwTextView ॱ;

    public WishWallListCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ʽ(view);
        this.ॱ = (HwTextView) view.findViewById(d.ꜟ);
        this.ˋ = (HwTextView) view.findViewById(d.ꓸ);
        this.ˎ = (HwTextView) view.findViewById(d.ˏˎ);
        this.ˏ = (HwTextView) view.findViewById(d.ʹ);
        this.ˊ = (HwTextView) view.findViewById(d.ﾟ);
        this.ʻ = view.findViewById(d.ꜞ);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof WishWallListCardBean) {
            WishWallListCardBean wishWallListCardBean = (WishWallListCardBean) cardBean;
            this.ॱ.setText(wishWallListCardBean.v_());
            String formatDateTime = DateUtils.formatDateTime(this.ʼॱ, wishWallListCardBean.ˊ(), 131092);
            this.ˋ.setText(this.ʼॱ.getString(f.ᐝॱ, new Object[]{formatDateTime}));
            this.ˎ.setText(this.ʼॱ.getString(f.ॱˋ, new Object[]{wishWallListCardBean.ʽ()}));
            this.ˏ.setText(this.ʼॱ.getString(f.ˊˊ, new Object[]{Integer.valueOf(wishWallListCardBean.ꓸ())}));
            if (wishWallListCardBean.ᶥ() == 1) {
                Drawable drawable = this.ʼॱ.getResources().getDrawable(e.ˏ);
                drawable.setBounds(0, 0, epv.ˋ(this.ʼॱ, 8), epv.ˋ(this.ʼॱ, 8));
                if (MinimumFactory.getBoolValue(ContentManager.getInstant().getContext())) {
                    this.ॱ.setCompoundDrawables(drawable, null, null, null);
                } else {
                    this.ॱ.setCompoundDrawables(null, null, drawable, null);
                }
                this.ॱ.setCompoundDrawablePadding(epv.ˋ(this.ʼॱ, 8));
            } else {
                this.ॱ.setCompoundDrawables(null, null, null, null);
            }
            if (wishWallListCardBean.ꜟ() == 1) {
                this.ˊ.setVisibility(0);
                this.ˊ.setText(this.ʼॱ.getString(f.ˋˋ));
                this.ˊ.setTextColor(this.ʼॱ.getResources().getColor(b.ˊ));
            } else if (wishWallListCardBean.ꜟ() == 2) {
                this.ˊ.setVisibility(0);
                this.ˊ.setText(this.ʼॱ.getString(f.ˏˏ));
                this.ˊ.setTextColor(this.ʼॱ.getResources().getColor(b.ʽ));
            } else if (wishWallListCardBean.ꜟ() == 3) {
                this.ˊ.setVisibility(0);
                this.ˊ.setText(this.ʼॱ.getString(f.ͺॱ));
                this.ˊ.setTextColor(this.ʼॱ.getResources().getColor(b.ʽ));
            } else {
                this.ˊ.setVisibility(8);
            }
            if (ˊᐝ()) {
                this.ʻ.setVisibility(0);
            } else {
                this.ʻ.setVisibility(8);
            }
        }
    }

    public void ॱ(chy o_chy) {
        OnClickListener anonymousClass4 = new evx(this) {
            final /* synthetic */ WishWallListCard ˊ;

            {
                this.ˊ = r1;
            }

            public void ˋ(View view) {
                WishWallListCardBean wishWallListCardBean = (WishWallListCardBean) this.ˊ.ˌ();
                cil.ˋ(this.ˊ.ʼॱ, new a(wishWallListCardBean).ˋ());
                fjb ˎ = fho.ˏ().ˋ("WishWall").ˎ("wishwall.detail.activity");
                WishWallDetailActivityProtocol wishWallDetailActivityProtocol = (WishWallDetailActivityProtocol) ˎ.ˊ();
                Request request = new Request();
                request.ˊ(wishWallListCardBean.ॱॱ());
                wishWallDetailActivityProtocol.ॱ(request);
                fiu.ˊ().ˏ(this.ˊ.ʼॱ, ˎ);
            }
        };
        View ˉ = ˉ();
        if (ˉ != null) {
            ˉ.setOnClickListener(anonymousClass4);
        }
    }

    public boolean ˊᐝ() {
        return !this.ˊᐝ.ॱㆍ();
    }
}
